#include "ScnsIwdg.c.h"

#if defined(SCNS_IWDG_ENABLE)&&SCNS_IWDG_ENABLE==1

#include "iwdg.h"

ScnsStatus scnsBspIwdgInit()
{
#ifdef IWDG
    MX_IWDG_Init();
#elif defined(IWDG1)
    MX_IWDG1_Init();
#endif
    return SCNS_STATUS_OK;
}

void scnsBspIwdgFeed(void)
{
#if defined(USE_FULL_LL_DRIVER)&&!defined(HAL_IWDG_MODULE_ENABLED)
#ifdef IWDG
    LL_IWDG_ReloadCounter(IWDG);
#elif defined(IWDG1)
    LL_IWDG_ReloadCounter(IWDG1);
#else
#error
#endif
#elif  defined(HAL_IWDG_MODULE_ENABLED)
#ifdef IWDG
    HAL_IWDG_Refresh(&hiwdg);
#elif defined(IWDG1)
    HAL_IWDG_Refresh(&hiwdg1);
#else
#error
#endif
#else
#error
#endif
}

#endif
